<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title>文章列表--layui后台管理模板 2.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="resources/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="resources/css/public.css" media="all" />
</head>
<body class="childrenBody">
<form class="layui-form" style="width:100%;" id="dataFrm">
    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label">编号:</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input lostNo" name="lostNo" lay-verify="required" readonly="readonly">
        </div>
    </div>
    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label">客户:</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input custName" name="customer.custName" lay-verify="required" disabled="disabled">
        </div>
    </div>
    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label">客户经理:</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input lostManagerName" name="lostManagerName" disabled="disabled">
        </div>
    </div>
    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label">上次下单时间:</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input lostLastOrderDate" name="lostLastOrderDate" disabled="disabled">
        </div>
    </div>
    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label">暂缓措施:</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input lostDelay1" disabled="disabled">
            <input type="hidden" class="layui-input lostCustNo" name="lostCustNo">
        </div>
    </div>
    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block lostStatus">
            <input type="radio" name="lostStatus" value="1" title="正常状态" >
            <input type="radio" name="lostStatus" value="2" title="暂缓流失" >
            <input type="radio" name="lostStatus" value="3" title="确认流失" >
        </div>
    </div>
    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label">流失原因:</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input lostReson" name="lostReson" lay-verify="required" >
        </div>
    </div>
    <div class="layui-form-item layui-row layui-col-xs12">
        <div class="layui-input-block">
            <button type="reset" class="layui-btn layui-btn-sm layui-btn-primary">返回</button>
            <button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="saveCustLost">保存</button>
        </div>
    </div>
</form>
<script type="text/javascript" src="resources/layui/layui.js"></script>
<script th:inline="none">
    layui.use(['form','layer','laydate','table','laytpl','upload'],function() {
        var form = layui.form
            layer = parent.layer === undefined ? layui.layer : top.layer,
            $ = layui.jquery,
            laydate = layui.laydate,
            laytpl = layui.laytpl,
            table = layui.table,
            upload=layui.upload;
       //提交数据
        form.on("submit(saveCustLost)",function (data) {
            var index = top.layer.msg('数据提交中，请稍候',{icon: 16,time:false,shade:0.8});
            //实际使用时的提交数据
            var params=$("#dataFrm").serialize();
            console.log(params);
            $.post("custLostConfireUpdate.do",params,function (res) {
                console.log(res.code);
                if(res.code==2005 ||res.code==2010){
                    top.layer.close(index);
                    top.layer.msg(res.msg);
                    var index1=parent.layer.getFrameIndex(window.name)
                    parent.layer.close(index1);
                    parent.location.reload();
                }else{
                    layer.msg(res.msg);
                }
            },"json");
            return false;
        });
    });
</script>
</body>
</html>